<div class="content">
	<div class="tab_bar">
		<ul>
			<li class="tab_index" onclick="setTabContent(this);"><h3>菜单管理</h3></li>
		</ul>
		<button class="btn_tabbar" action="menu/add.do" onclick="refreshContentByElement(this);">添加菜单</button>
	</div>
	<div class="tab_content">
		<div class="tab_item tab_show">
			<table class="table_for_list">
				<thead>
				<tr>
			        <th width="120">菜单名称</th>
			        <th>URL地址</th>
			        <th>排序</th>
			        <th>描述</th>
			        <th width="80">操作</th>
			      </tr>
				</thead>
			    <tbody>
				  <@menuTree id = 0 node = -1/>
				</tbody>
			</table>
		</div>
	</div>
</div> 
<#macro menuTree id node>
	<#local temp = node + 1 />
	<#list menus as menu>
		<#if menu.id != 0>
		  	<#if id = menu.pid>
				<tr>
			        <td>
			        	<#if temp gt 0 ><#list 1..temp as x>&nbsp; &nbsp;</#list>├</#if> <i class="fa ${menu.icon!}"></i> ${menu.name!} 
			        </td>
			        <td>${menu.url!} </td>
			        <td class="tac">${menu.sort?c} </td>
			        <td>${menu.description!} </td>
			        <td>
			        <a href="#" action="menu/edit.do?id=${menu.id?c}" onclick="refreshContentByElement(this,event);">修改</a> 
			    	 | <a href="#" action="menu/delete.do?rid=${menu.id?c}" return="menu/list.do" onclick="deleteById(this);">删除</a>
			    </tr>
		    <@menuTree id = menu.id node=temp/>
	      	</#if>
        </#if>
	</#list> 
</#macro>

